﻿@model KKU.RBSFPP.Shared.DAC.Product

@{
    ViewBag.Title = "Edit";
}
@Html.Partial("_AccountManagement")

<p>
    <a class="btn btn-success" ><span class="glyphicon glyphicon-edit"></span> แก้ไขของเก่า</a>
</p>


@using (Html.BeginForm()) {
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)
        
        
         
    
    <fieldset>
        <legend></legend>

        @Html.HiddenFor(model => model.Id)

       <h4>ชื่อของเก่า</h4>
        <div class="editor-field">
            @Html.TextBoxFor(model => model.Name, new { @class="form-control" ,placeholder="ชื่อของเก่า"})
            @Html.ValidationMessageFor(model => model.Name)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.CategoryId, "ประเภท")
        </div>
        <div class="editor-field">
            @Html.DropDownList("CategoryId", String.Empty)
            @Html.ValidationMessageFor(model => model.CategoryId)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ProductUnitId, "หน่วย")
        </div>
        <div class="editor-field">
            @Html.DropDownList("ProductUnitId", String.Empty)
            @Html.ValidationMessageFor(model => model.ProductUnitId)
        </div>

        @{ 
            double buyValue = ViewBag.buy;
            double sellValue = ViewBag.sell;
        }

         <h5>ราคาซื้อ</h5>
        <div class="editor-field">
            @Html.TextBox("buy", buyValue, new { @class = "form-control", placeholder = "ราคาซื้อ" })
            @Html.ValidationMessageFor(Model => Model.Name)

        </div>
        <h5>ราคาขาย</h5>
        <div>
            @Html.TextBox("sell", sellValue, new { @class = "form-control", placeholder = "ราคาขาย" })
            @Html.ValidationMessageFor(Model => Model.Name)
        </div>



       @* <div class="editor-label">
            @Html.LabelFor(model => model.ProductPricingPerUnitId, "ราคาซื้อ-ขาย")
        </div>
        <div class="editor-field">
            @Html.DropDownList("ProductPricingPerUnitId", String.Empty)
            @Html.ValidationMessageFor(model => model.ProductPricingPerUnitId)
        </div>*@

        @Html.HiddenFor(model => model.CreateOn)


         <legend></legend>

         <p>
            <a href=@Url.Action("Index", "Product") class="btn btn-danger"><span class="glyphicon glyphicon-remove-circle"></span> ยกเลิก</a>
            <button type="submit" class="btn btn-success"><span class="glyphicon glyphicon-ok-circle"></span> ตกลง</button>
        </p>

        
    </fieldset>
}


@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
